'''
@Descripttion: 
@version: 
@Author: dkolli
@Date: 2019-11-02 01:29:11
@LastEditors: sueRimn
@LastEditTime: 2019-11-02 01:49:34
'''
class Student(object):
    count = 0  # Student类的属性
    def __init__(self, name):
        self.name = name
        # 每初始化一个实例对象，就毁掉用一次Student的add_num方法
        self.add_num() 
        
    def add_num(self):
        # 计数增加1
        Student.count += 1
        

xiaohong = Student('xiaohong')
print('创建了%d个学生实例' % Student.count)

xiaobai = Student('xiaobai')
print('创建了%d个学生实例' % Student.count)

xiaobai = Student('xiaobai')
print('创建了%d个学生实例' % Student.count)

        
